﻿<Window x:Class="XCase.Controller.Dialogs.ClassDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Dialogs="clr-namespace:XCase.Controller.Dialogs"
    Title="Class: {0}" Height="328" Width="374" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" ResizeMode="NoResize" Topmost="True">
    <Grid>
        <Button Height="23" Margin="0,0,198,12" Name="bOk" VerticalAlignment="Bottom" IsDefault="True" Click="bOk_Click" HorizontalAlignment="Right" Width="87" TabIndex="2">
			<Button.Content>_OK</Button.Content>
		</Button>
		<Button Height="23" Margin="0,0,105,12" Name="bApply" VerticalAlignment="Bottom" Click="bApply_Click" HorizontalAlignment="Right" Width="87" IsEnabled="False" TabIndex="3">Apply</Button>
        <Button Height="23" HorizontalAlignment="Right" Margin="0,0,12,12" Name="bCancel" VerticalAlignment="Bottom" Width="87" IsCancel="True" TabIndex="4">Cancel</Button>
        <TabControl Margin="12,12,12,41" Name="tabControl1">
            <TabItem Header="General" Name="tabGeneral" TabIndex="0">
                <TabItem.Resources>
                    <DataTemplate x:Key="packageTemplate">
                        <TextBlock Text="{Binding Path=QualifiedName}" />
                    </DataTemplate>
                </TabItem.Resources>
                <DockPanel>
					<GroupBox Header="Class general properties" Name="groupBox1" >
						<Canvas>
							<Dialogs:RememberingTextBox x:Name="tbName" TextChanged="tbName_TextChanged" Height="22" Canvas.Left="74" Canvas.Top="14" Width="226" TabIndex="0" />
							<Label Name="label1" Height="26" Canvas.Left="10" Canvas.Top="12" Width="44">Name:</Label>
							
							<Canvas Canvas.Left="0" Canvas.Top="42" Height="42" Name="cPackage" Width="300">
								<ComboBox x:Name="cbPackages" ItemTemplate="{StaticResource packageTemplate}" SelectionChanged="cbPackages_SelectionChanged" Height="22" Canvas.Left="74" Canvas.Top="0" Width="226" TabIndex="1" />
								<Label Name="label3" Height="26" Canvas.Left="10" Canvas.Top="0" Width="56">Package:</Label>

							</Canvas>
                            <Dialogs:RememberingTextBox Canvas.Left="74" Canvas.Top="118" Height="22" x:Name="tbOnto" TabIndex="0" Width="226" TextChanged="tbOnto_TextChanged" />
                            <Label Canvas.Left="10" Canvas.Top="88" Content="Ontology equivalent:" Height="28" Name="label2" Width="121" />
                        </Canvas>
					</GroupBox>
				</DockPanel>
            </TabItem>
            <TabItem Header="Attributes" Name="tabAttributes" TabIndex="1">
                <DockPanel>
					<DataGrid 
						Name="gridAttributes" 
						CanUserAddRows="True" CanUserDeleteRows="True" CanUserResizeRows="False" 
						SelectionMode="Single"
						Dialogs:AccessKeyScoper.IsAccessKeyScope="True"
						AutoGenerateColumns="False" CellEditEnding="gridAttributes_CellEditEnding" RowEditEnding="gridAttributes_RowEditEnding" AlternatingRowBackground="Beige" Background="Cornsilk" BorderBrush="LightGray" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" RowBackground="Cornsilk">
                        <DataGrid.Resources>
                            <Style x:Key="CellEditStyle" TargetType="{x:Type TextBox}">
                                <Setter Property="BorderThickness" Value="0"/>
                                <Setter Property="Padding" Value="0"/>
                                <Style.Triggers>
                                    <Trigger Property="Validation.HasError" Value="true">
                                        <Setter Property="ToolTip"
                                            Value="{Binding RelativeSource={RelativeSource Self},
                                            Path=(Validation.Errors)[0].ErrorContent}"/>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </DataGrid.Resources>
						<DataGrid.Columns>
							<DataGridTextColumn Header="Attribute" MinWidth="70" x:Name="nameColumn" Binding="{Binding Name}" CanUserReorder="False"  />
							<DataGridComboBoxColumn Header="Type" MinWidth="80" x:Name="typeColumn" SelectedValueBinding="{Binding Type}"   />
							<DataGridTextColumn Header="Default value" x:Name="defaultValueColumn" Binding="{Binding Default}" />
							<DataGridTextColumn Header="Multiplicity" x:Name="multiplicityColumn" Binding="{Binding Multiplicity,  ValidatesOnExceptions=True}" EditingElementStyle="{StaticResource CellEditStyle}"  />
						</DataGrid.Columns>
					</DataGrid>
                </DockPanel>
            </TabItem>
        </TabControl>
    </Grid>
</Window>
